package com.zhny.meddleware;

import com.zhny.protocol_v3_008.network.Sender;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.TreeMap;

/**
 * Create By Alex On 2018/4/10 16:03
 */
@Component
public class SenderProxy {

    @Autowired
    private Sender sender;

    private String site;

    private TreeMap<Integer,Short> deviceTable;

    public void start() {
        sender.start();
    }

    public void register(){
        sender.register(deviceTable);
    }

    public void register(int deviceFlag,short deviceType){
        sender.register(deviceFlag,deviceType);
    }

    public void deleteDevice(int deviceFlag) {
        sender.deleteDevice(deviceFlag);
    }

    public void init(TreeMap<Integer,Short> deviceTable) {
        this.deviceTable = deviceTable;
    }
}
